bitkeeper revision 1.252 (3eddffe6IQ1eZ1bHUcbBhwG8ApEXrA)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 4 Jun 2003 14:19:18 +0000 (14:19 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 4 Jun 2003 14:19:18 +0000 (14:19 +0000)
processor.h, setup.c, process.c:
  Further IOPL fix -- also initial idle thread has current->thread.esp0 initialised to a non-zero value.

xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c
xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c
xenolinux-2.4.21-pre4-sparse/include/asm-xeno/processor.h

index c1764fce50e47e8708bcefe2e384d2114c22d6bd..b4e7a6cd148051b4f96f24f9c1ccee87adc5c438 100644 (file)
@@ -365,14 +365,11 @@ void __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
         queue_multicall0(__HYPERVISOR_fpu_taskswitch);
     }
 
-    if ( next->esp0 != 0 )
-    {
-        queue_multicall2(__HYPERVISOR_stack_switch, __KERNEL_DS, next->esp0);
-        /* Next call will silently fail if we are a non-privileged guest OS. */
-        queue_multicall2(__HYPERVISOR_set_priv_levels,
-                         ((((struct pt_regs *)next->esp0)-1)->eflags>>12)&3,
-                         next->hypercall_pl);
-    }
+    queue_multicall2(__HYPERVISOR_stack_switch, __KERNEL_DS, next->esp0);
+    /* Next call will silently fail if we are a non-privileged guest OS. */
+    queue_multicall2(__HYPERVISOR_set_priv_levels,
+                     ((((struct pt_regs *)next->esp0)-1)->eflags>>12)&3,
+                     next->hypercall_pl);
 
     /* EXECUTE ALL TASK SWITCH XEN SYSCALLS AT THIS POINT. */
     execute_multicall_list();
index 21db2e8f018d61c91ff6c446748ee9ced35053c5..68fedf85fd6862889047729ea9e836bfa76685d5 100644 (file)
@@ -302,7 +302,6 @@ void __init setup_arch(char **cmdline_p)
 
     paging_init();
 
-    /* Set privilege level gubbins. */
     regs->eflags &= ~(3<<12);
     if ( start_info.flags & SIF_PRIVILEGED ) {
         /* We are privileged guest os - should have IO privileges. */
@@ -310,7 +309,6 @@ void __init setup_arch(char **cmdline_p)
             panic("Unable to obtain IOPL, despite being SIF_PRIVILEGED");
         regs->eflags |= 1<<12;
     }
-    current->thread.hypercall_pl = 1;
 
     if(start_info.flags & SIF_CONSOLE)
     {
index d3547ea2bc09f34395d358a8a70b4a1c135e8593..eb2effd3f074f6b59504872eed129a65acd83423 100644 (file)
@@ -369,7 +369,8 @@ struct thread_struct {
        unsigned long           v86flags, v86mask, saved_esp0;
 };
 
-#define INIT_THREAD  { 0, 0, 0, 0, 0, 1, {0}, 0, 0, 0, {0}, 0, 0, 0, 0, 0 }
+#define INIT_THREAD  { sizeof(init_stack) + (long) &init_stack, \
+                       0, 0, 0, 0, 1, {0}, 0, 0, 0, {0}, 0, 0, 0, 0, 0 }
 
 #define INIT_TSS  {                                            \
        0,0, /* back_link, __blh */                             \